package com.tester.zc.test001.fifth;

/**
 *电压适配器类
 *
 * @Author zhoucan
 * @Date 2022/12/4
 */
public class VoltageAdapter implements FiveVolts{

    private TwoHundredAndTwentyVolts twoHundredAndTwentyVolts;

    public VoltageAdapter(TwoHundredAndTwentyVolts twoHundredAndTwentyVolts) {
        this.twoHundredAndTwentyVolts = twoHundredAndTwentyVolts;
    }

    public int outputFiveVolts() {
        //提供220v电压
        int voltage = twoHundredAndTwentyVolts.outputTwoHundredAndTwentyVolts();
        //将220v电压降为5v
        return voltage/44;
    }
}
